package composite;

/**
 * @program: DesignModeProject
 * @description:
 * @author: Li canzhang
 * @create: 2022-05-29 21:53
 **/
public class Client {
    public static void main(String[] args) {
        //从大到小创建对象  学校
        OrganizationComponent university = new University("厦门工学院", "艾利斯顿商学院");

        //学院
        OrganizationComponent computerCollege = new College("计算机学院", "就是计算机学院");
        OrganizationComponent financeCollege = new College("商学院", "就是商学院");

        //创建各个学院的系
        computerCollege.add(new Department("软件工程","就是软件工程"));
        computerCollege.add(new Department("网络工程","就是网络工程"));

        financeCollege.add(new Department("财管","就是财管"));
        financeCollege.add(new Department("投资","就是投资"));

        university.add(computerCollege);
        university.add(financeCollege);


        university.print();

        computerCollege.print();

        financeCollege.print();
    }
}
